<html>﻿<!DOCTYPE html>
<html>
<head>
<script src="../../../../../../g.alicdn.com/kissy/k/1.4.7/seed.js" tppabs="http://g.alicdn.com/kissy/k/1.4.7/seed.js" data-config="{combine:true}"></script>
</head>
<body>
    
    <div id='cool' style='display:none;width:200px;height:100px;line-height:100px;border:1px solid red;'>
        
        ooh,some cool features shows
        
    </div>
        
    <label>输入 hash :<input id='in' /> </label>
    
    <button id='ok'>确定</button>
    
    
    <div>try input cool ,enter then after 1 second navigate back</div>
    
    <a href="hashchange.html-x.htm" tppabs="http://docs.kissyui.com/1.4/source/raw/api/event/hashchange.html?x" target="_blank">新窗口打开</a>

<script>       
    KISSY.use("node",function(S,Node){   
        location.hash='#';
        var $=Node.all;
        
        $('#ok').on("click",function(){
            location.hash="!/"+$("#in").val()+"/";
        });
        
        $('#in').on("keydown",function(e){
            if(e.keyCode==13)
            location.hash="!/"+$("#in").val()+"/";
        });
        
        $(window).on("hashchange",function(){
            if(location.hash == "#!/cool/"){
                $("#cool").show(1);
            }else{
                $("#cool").stop(true).hide();
            }
        });
    });
</script>

</body>
</html>